/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author Elizangela
 */

@FacesConverter(value="proprietarioConverter")
public class ProprietarioConverter implements Converter {

 @Override
 public Object getAsObject(FacesContext fc, UIComponent uic, String string) {
     Proprietario p = new Proprietario();
     p.setCodDono(Integer.parseInt(string));
     return p;
 }

 @Override
 public String getAsString(FacesContext fc, UIComponent uic, Object o) {
     Proprietario p = new Proprietario(); 
     p = (Proprietario) o;
     return p.getDono();
    }



    
}
